import request from '@/router/axios'
import store from '@/store'
import {
  replayStatus,
  fenExYuangettoFixed,
  getreplayStatusFormat,
  getLineName,
  getStationName,
  allStatus
} from "../subwayRat/commonCheck";
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  selection: true,
  reserveSelection:false,
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    type: 'input',
    hide: true
  }, {
    hide: false,
    label: '线路',
    prop: 'lineCode',
    type: 'select',
    search: true,
    searchslot:true,
    formatter: function(row, value , label, column){
      return getLineName(value);
    },
    // cascaderItem: ["stationCode"],
    // props: {
    //   label: 'name',
    //   value: 'code'
    // },
    // formatter: function(row, value , label, column){
    //   return getLineName(value);
    // }
    // ,
    // dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    display: true // 动态显隐控制不能删除
  }, {
    hide: false,
    label: '站点',
    prop: 'stationCode',
    searchslot:true,
    // cascaderItem: ['equipmentNumber','conductorPersonCode'],
    // type: 'select',
    search: true,
    formatter: function(row, value , label, column){
      return getStationName(row.lineCode,value);
    },
    // dicFlag: false,
    // props: {
    //   label: 'name',
    //   value: 'code'
    // },
    // formatter: function(row, value , label, column){
    //   return getStationName(row.lineCode,value);
    // },
    // dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    display: true// 动态显隐控制不能删除
  },{
    hide: true,
    label: '售票员',
    prop: 'conductorPersonCode',
    type: 'select',
    search: true,
    searchslot:true,
    // dicFlag: false,
    // props: {
    //   label: 'nikename',
    //   value: 'userCode'
    // },
    // dicUrl: "/check/check/getPersonRoleToLS?stationCode={{key}}",
    display: true// 动态显隐控制不能删除
  }, {
    width: 120,
    hide: false,
    label: '设备操作号',
    prop: 'equipmentNumber',
    type: 'select',
    search: true,
    searchslot:true,
    // dicFlag: false,
    // props: {
    //   label: 'operationCode',
    //   value: 'operationCode'
    // },
    // dicUrl: "/check/check/getSwPmDeviceOperationCodeList?stationCode={{key}}",
    display: true// 动态显隐控制不能删除
  }, {
    hide: false,
    label: 'BOM编号',
    prop: 'bomCode',
    type: 'select',
    search: false,
    searchslot : true,
    display: true// 动态显隐控制不能删除
  },{
    label: '收入日期',
    prop: 'settleTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: false
  }, {
    label: '售票员',
    prop: 'conductorPersonName',
    search: false,
    hide: false,
  }, {
    width: 120,
    label: 'LC售票金额',
    prop: 'sellAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'sellAmount');
    },
    search: false,
    hide: false,
  }, {
    width: 120,
    label: 'LC充值金额',
    prop: 'investAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'investAmount');
    },
    search: false,
    hide: false,
  }, {
    width: 120,
    label: 'LC补票金额',
    prop: 'faretkAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'faretkAmount');
    },
    search: false,
    hide: false,
  }, {
    width: 120,
    label: 'ACC售票金额',
    prop: 'comparativeSelltkAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'comparativeSelltkAmount');
    },
    search: false,
    hide: false,
  }, {
    width: 120,
    label: 'ACC充值金额',
    prop: 'comparativeInvestAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'comparativeInvestAmount');
    },
    search: false,
    hide: false,
  }, {
    width: 120,
    label: 'ACC补票金额',
    prop: 'comparativeFaretkAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'comparativeFaretkAmount');
    },
    search: false,
    hide: false,
  }, {
    width: 200,
    label: '归属清分回馈差异原因',
    prop: 'qfReplyReason',
    dicData:allStatus['JD_REPLY_REASON']
  }, {
    label: '状态',
    prop: 'qfReplyStatus',
    search: true,
    type:'select',
    searchValue:'0',//默认未回馈
    dicData:replayStatus(),
    formatter:function(row, value , label, column) {
      return getreplayStatusFormat(value);
    },
    hide: false
  },{
    label: '通知时间',
    prop: 'assistTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: true
  }]
}
export function getSwAuConductorHierarchyAmountDifferenList(param) {
  return request({
    url: '/check/checkNew/getSwAuConductorHierarchyAmountDifferenList',
    method: 'post',
    data: param
  })
}
export function updateSwAuConductorHierarchyAmountDifferen(param) {
  return request({
    url: '/check/checkNew/updateSwAuConductorHierarchyAmountDifferen',
    method: 'post',
    data: param
  })
}
export function updateSwAuConductorHierarchyAmountDifferenToStatus(param) {
  return request({
    url: '/check/checkNew/updateSwAuConductorHierarchyAmountDifferenToStatus',
    method: 'post',
    data: param
  })
}
/**
 * 导入
 * @param body
 */
 export function importBOMJDorQF(body) {
  return request({
    url: "/check/checkNew/importBOMJDorQF",
    headers: { "Content-Type": "multipart/form-data" },
    method: "post",
    data: body
  });
}
/**
 * 导出
 * @param query
 */
 export function exportBOMJDorQF(query) {
  return request({
    url: '/check/checkNew/exportBOMJDorQF',
    method: 'get',
    params: query,
    responseType:'blob'
  })
}
